package org.jivesoftware.smackx.workgroup.packet;

import java.util.ArrayList;
import java.util.List;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.xmlpull.v1.XmlPullParser;

public class TranscriptProvider
  implements IQProvider
{
  public IQ parseIQ(XmlPullParser paramXmlPullParser)
    throws Exception
  {
    String str = paramXmlPullParser.getAttributeValue("", "sessionID");
    ArrayList localArrayList = new ArrayList();
    int i = 0;
    while (true)
    {
      int j;
      label107: 
      do
        while (true)
        {
          do
            while (true)
            {
              if (i != 0)
                return new Transcript(str, localArrayList);
              j = paramXmlPullParser.next();
              if (j != 2)
                break label107;
              if (!(paramXmlPullParser.getName().equals("message")))
                break;
              localArrayList.add(PacketParserUtils.parseMessage(paramXmlPullParser));
            }
          while (!(paramXmlPullParser.getName().equals("presence")));
          localArrayList.add(PacketParserUtils.parsePresence(paramXmlPullParser));
        }
      while ((j != 3) || (!(paramXmlPullParser.getName().equals("transcript"))));
      i = 1;
    }
  }
}